package com.cc.config;

import org.springframework.context.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 33314
 * @version 1.0
 * @description: TODO
 * @date 2025/6/24 14:49
 */
@Configuration
@ComponentScan(
//        指定要扫描的包
        basePackages = "com.cc",
//        扫描除了Controller类的其他类
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = Controller.class),
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = RestController.class)
        }
)
@PropertySource("classpath:database.properties")  //加载 连接数据库 文件
@Import({JdbcConfig.class, MybatisConfig.class})  // 导入 JdbcConfig.class MybatisConfig.class
@EnableTransactionManagement    //开启事务
public class SpringConfig {
}